GDK W32: Support smooth scrolling
authorРуслан Ижбулатов <lrn1986@gmail.com>
Tue, 7 Aug 2018 21:29:21 +0000 (21:29 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Tue, 7 Aug 2018 22:15:07 +0000 (22:15 +0000)
commit359df028be7b1dae76a1abb9bad8a3b86a648765
treefe2b9bc5e2af401c141caa99a9a623ca60c9c143
parent9008f7702dff689ce48f2cfa7ce42db099e4ef0c
GDK W32: Support smooth scrolling

Set delta_x or delta_y for GdkScrollEvent.
HIWORD (wParam) in WM_MOUSE(H)WHEEL is the scroll delta.
A delta value of WHEEL_DELTA (which is 120) means scrolling
one full unit of something (for example, a line).

The delta should also be multiplied by the value that the
SystemParametersInfo (SPI_GETWHEELSCROLL(LINES|CHARS), 0, &value, 0)
call gives back, unless it gives back 0xffffffff, in which case
it indicates that scrolling is page- or screen-based, not line-based
(GDK doesn't support that at the moment).

Also, all deltas should be inverted, since MS sends negative deltas
when scrolling down (rotating the wheel back, in the direction of
the user).

With deltas set the mode should be set to GDK_SCROLL_SMOOTH.

Fixes issue 1263.
gdk/win32/gdkevents-win32.c